<!--
 * @Author: daidai
 * @Date: 2022-01-12 14:23:32
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-09-09 14:47:24
 * @FilePath: \web-pc\src\pages\big-screen\view\home.vue
-->
<template>
  <div class="outer2">
    <ScaleScreen :width="1920" :height="1080" class="scale-wrap">
      <div class="bg">
        <dv-loading v-if="loading">Loading...</dv-loading>
        <div v-else class="host-body">
          <div class="d-flex jc-center title_wrap">
            <div class="zuojuxing"></div>
            <div class="youjuxing"></div>
            <div class="guang"></div>
            <div class="d-flex jc-center">
              <div class="title topTitle">
                <div class="title-left">历次考试统计总览</div>
                <span class="title-text title-middle">OSCE系统考试驾驶舱</span>
                <div class="title-right">
                  <div>{{ yearMonthDay }}</div>
                  <div style="padding:0 14px 0 10px;">{{ weekday }}</div>
                  <div><flip-clock /></div>
                </div>
              </div>
            </div>
            <div class="timers">
              {{ dateYear }} {{ dateWeek }} {{ dateDay }}
              <i class="blq-icon-shezhi02" style="margin-left: 10px"></i>
            </div>
          </div>
          <div class="inner">
            <div class="innerTop">
              <dv-border-box-13 style="height: 220px;">
                <div class="user_Overview flex" v-if="loadFlag">
                  <div class="user_Overview-item" style="color: #00fdfa">
                    <div class="user_Overview_nums allnum ">
                      {{ count.recordsCount === null ? '暂无' : count.recordsCount }}
                      <!-- <dv-digital-flop :config="recordsCount" style="width:100%;height:100%;" /> -->
                    </div>
                    <p>总考试数</p>
                  </div>
                  <div class="user_Overview-item" style="color: #00fdfa">
                    <div class="user_Overview_nums allnum">
                      {{ count.arecordsCount === null ? '暂无' : count.arecordsCount }}
                      <!-- <dv-digital-flop :config="arecordsCount" style="width:100%;height:100%;" /> -->
                    </div>
                    <p>A类考试</p>
                  </div>
                  <div class="user_Overview-item" style="color: #00fdfa">
                    <div class="user_Overview_nums allnum">
                      {{ count.brecordsCount === null ? '暂无' : count.brecordsCount }}
                      <!-- <dv-digital-flop :config="brecordsCount" style="width:100%;height:100%;" /> -->
                    </div>
                    <p>B类考试</p>
                  </div>
                  <div class="user_Overview-item" style="color: #00fdfa">
                    <div class="user_Overview_nums allnum">
                      {{ count.examinationCount === null ? '暂无' : count.examinationCount }}
                      <!-- <dv-digital-flop :config="examinationCount" style="width:100%;height:100%;" /> -->
                    </div>
                    <p>总考题数</p>
                  </div>
                  <div class="user_Overview-item" style="color: #00fdfa">
                    <div class="user_Overview_nums allnum">
                      {{ count.studentCount === null ? '暂无' : count.studentCount }}
                      <!-- <dv-digital-flop :config="studentCount" style="width:100%;height:100%;" /> -->
                    </div>
                    <p>参加总考生数</p>
                  </div>
                  <div class="user_Overview-item" style="color: #00fdfa">
                    <div class="user_Overview_nums allnum">
                      {{ count.apassPercent === null ? '暂无' : count.apassPercent }}
                      <!-- <dv-digital-flop :config="apassPercent" style="width:100%;height:100%;" /> -->
                    </div>
                    <p>A类考试通过率</p>
                  </div>
                </div>
              </dv-border-box-13>
            </div>
            <div class="innerBottom">
              <div class="botLeft">
                <dv-border-box-13 style="height: 750px;">
                  <left-center></left-center>
                </dv-border-box-13>
              </div>
              <div class="botMiddle">
                <dv-border-box-13 style="height: 750px;">
                  <middle-center></middle-center>
                </dv-border-box-13>
              </div>
              <div class="botRight">
                <dv-border-box-13 style="height: 750px;">
                  <div class="top" style="padding: 26px 10px 0 10px;">
                    <div class="top_bg">
                      <a-map ref='aMaps'></a-map>
                    </div>
                    <!-- <iframe style="height: 450px;width: 600px;border: none;" src='http://keshihua.51qingtian.com/#/release?releaseId=2b2f4cd945dc42f490d25b201da0c2e1'></iframe> -->
                  </div>
                  <div class="bottom">
                    <right-center-bottom></right-center-bottom>
                  </div>
                </dv-border-box-13>
              </div>
            </div>
          </div>
        </div>
      </div>
    </ScaleScreen>
  </div>
</template>

<script>
import ScaleScreen from './scale-screen/scale-screen.vue'
import leftCenter from './components/left-center.vue'
import middleCenter from './components/middle-center.vue'
import aMap from './components/a-map.vue'
import rightCenterBottom from './components/right-center-bottom.vue'
import { jiashicangQueryF } from '@/api/driver.js'
import { queryMap } from '@/api/index.js'
import moment from 'moment'
import FlipClock from 'kuan-vue-flip-clock'

let style = {
  fontSize: 30
}
export default {
  components: {
    ScaleScreen,
    leftCenter,
    middleCenter,
    rightCenterBottom,
    FlipClock,
    aMap

  },
  data () {
    return {
      timing: null,
      loading: false,
      dateDay: null,
      dateYear: null,
      dateWeek: null,
      weekdayArr: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
      yearMonthDay: '',
      weekday: '',
      loadFlag: false,
      count: {
        recordsCount: '',
        arecordsCount: '',
        brecordsCount: '',
        examinationCount: '',
        studentCount: '',
        apassPercent: ''
      },
      recordsCount: {
        number: [0],
        content: '{nt}',
        style: {
          ...style,
            // stroke: "#00fdfa",
          fill: '#00fdfa'
        }
      },
      arecordsCount: {
        number: [0],
        content: '{nt}',
        style: {
          ...style,
          // stroke: "#00fdfa",
          fill: '#00fdfa'
        }
      },
      brecordsCount: {
        number: [0],
        content: '{nt}',
        style: {
          ...style,
          // stroke: "#00fdfa",
          fill: '#00fdfa'
        }
      },
      examinationCount: {
        number: [0],
        content: '{nt}',
        style: {
          ...style,
          // stroke: "#00fdfa",
          fill: '#00fdfa'
        }
      },
      studentCount: {
        number: [0],
        content: '{nt}',
        style: {
          ...style,
          // stroke: "#00fdfa",
          fill: '#00fdfa'
        }
      },
      apassPercent: {
        number: [0],
        content: '{nt}',
        style: {
          ...style,
          // stroke: '#00fdfa',
          fill: '#00fdfa'
        }
      }
    }
  },
  computed: {},
  created () {
    this.getJiashicangQueryF()
    // this.getQueryMap()
    setTimeout(() => {
      this.$refs.aMaps.getQueryMap()
    }, 10)
    this.getTime()
  },
  mounted () {
  },
  beforeDestroy () {
  },
  methods: {
    // 获取时间
    getTime () {
      let newDate = new Date()
      this.weekday = this.weekdayArr[moment(newDate).weekday()]
      this.yearMonthDay = moment(newDate).format('YYYY-MM-DD')
    },
    getQueryMap () {
      let params = {}
      queryMap(params).then(res => {
        console.log(res)
      })
    },
    getJiashicangQueryF () {
      this.loadFlag = false
      jiashicangQueryF().then(res => {
        this.count = res.data.data
        // this.recordsCount.number = [res.data.data.recordsCount]
        // this.arecordsCount.number = [res.data.data.arecordsCount]
        // this.brecordsCount.number = [res.data.data.brecordsCount]
        // this.examinationCount.number = [res.data.data.examinationCount]
        // this.studentCount.number = [res.data.data.studentCount]
        // this.apassPercent.number = [res.data.data.apassPercent]
        this.loadFlag = true
      })
    }
  }
}
</script>

<style lang="scss">
@import "./components/home.scss";
.dv-border-svg-container{
  position: absolute !important;
}
.outer2 {
  height: 100vh;
  width: 100vw;
  background: #03050C;

  .inner {
    display: flex;
    flex-direction: column;
    height: 100%;

    .innerTop {
      height: 220px;
      width: 100%;
      margin-bottom: 10px;
    }

    .innerBottom {
      width: 100%;
      height: 750px;
      display: flex;

      .botLeft {
        width: 35%;
        height: 750px;
      }

      .botMiddle {
        width: 30%;
        height: 750px;
        margin: 0 20px;
      }

      .botRight {
        width: 35%;
        height: 750px;
        .top{
          height: 410px;
          width: 100%;
          .top_bg{
            height: 100%;
            width: 100%;
          }
          // .top_bg{
          //   height: 100%;
          //   width: 90%;
          //   margin: 0 auto;
          //   background: url(~@/assets/img/map.png);
          //   background-size: 100% 100%;
          // }
        }
        .bottom{
          height: 330px;
          width: 100%;
        }
      }
    }
  }
}
</style>
<style lang='scss' scoped>
.user_Overview {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-top: 20px;
  .user_Overview-item {
    height: 200px;
    width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    p {
      text-align: center;
      height: 16px;
      font-size: 26px;
    }

    .user_Overview_nums {
      width: 120px;
      height: 120px;
      text-align: center;
      line-height: 120px;
      font-size: 26px;
      // margin: 50px auto 30px;
      background-size: cover;
      background-position: center center;
      position: relative;

      &::before {
        content: '';
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
      }

      &.bgdonghua::before {
        animation: rotating 14s linear infinite;
      }
    }
    .allnum {
      background-image: url("~@/assets/img/left_top_lan.png");

      // &::before {
      //   background-image: url("~@/assets/img/left_top_lan.png");
      // }
    }
    .online {
      background-image: url("~@/assets/img/left_top_lv.png");
      // &::before {
      //   background-image: url("~@/assets/img/left_top_lv.png");
      // }
    }
    .offline {
      background-image: url("~@/assets/img/left_top_huang.png");
      // &::before {
      //   background-image: url("~@/assets/img/left_top_huang.png");
      // }
    }
    .laramnum {
      background-image: url("~@/assets/img/left_top_hong.png");
      // &::before {
      //   background-image: url("~@/assets/img/left_top_hong.png");
      // }
    }
  }
}
</style>
<style lang="scss">
.topTitle{
  display: flex;
  .title-left{
    padding-left: 20px;
    padding-right: 140px;
    padding-top: 10px;
    width: 30%;
    font-size: 22px !important;
    color: #01AAFF;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 24px;
    font-weight: 500;
  }
  .title-middle{
    flex: 1;
  }
  .title-right{
    padding-left: 120px;
    padding-right: 10px;
    padding-top: 10px;
    width: 30%;
    font-size: 22px !important;
    color: #01AAFF;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 24px;
    display: flex;
  }
}
// 时钟 ⏰
.test-clock-container {
  font: normal 14px "Helvetica Neue", Helvetica, sans-serif;
  user-select: none;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
  background: radial-gradient(ellipse at center, #969696 0%, #595959 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.flip{
  height: 30px !important;
  line-height: 30px !important;
  width: 20px !important;
  border-radius: 2px !important;
  padding: 0 !important;
  margin: 0 2px !important;
  .item{
    .inn{
      font-size: 18px !important;
      color: #01AAFF !important;
    }
  }
} 
.colon{
  padding: 0 2px !important;
  height: 26px !important;
} 
.colon:before{
  background: #01AAFF80 !important;
  height: 6px !important;
  width: 6px !important;
}
.colon:after{
  background: #01AAFF80 !important;
  height: 6px !important;
  width: 6px !important;
}
</style>